import { Vector3Tuple } from 'three-legacy';
import { MeasureObject } from './renderObject';
import { MeasureAngle } from './Angle';
import { MeasureDistanceObj } from './Distance';
import { DistanceLine } from './DistanceLine';
import { MeasureLabel } from './Label';
import {
  MeasureAngleResult,
  MeasureDistanceResult,
  MeasureNumberResult,
} from '@amcax/base';

export type MeasureNumberResultWithLabel = MeasureNumberResult & {
  labelPosition?: Vector3Tuple;
};

export type MeasureDistanceResultWithLabel = MeasureDistanceResult & {
  labelPosition?: Vector3Tuple;
  labelPositionX?: Vector3Tuple;
  labelPositionY?: Vector3Tuple;
  labelPositionZ?: Vector3Tuple;
};

export type MeasureAngleResultWithLabel = MeasureAngleResult & {
  labelPosition?: Vector3Tuple;
};

export type MeasureResult = {
  id: string;
  dxid1: string;
  dxid2?: string;
  length?: MeasureNumberResultWithLabel;
  radius?: MeasureNumberResultWithLabel;
  minDistance?: MeasureDistanceResultWithLabel;
  centerDistance?: MeasureDistanceResultWithLabel;
  angle?: MeasureAngleResultWithLabel;
  area?: MeasureNumberResultWithLabel;
  round?: MeasureNumberResultWithLabel;
  coordinate?: Vector3Tuple;
};

export type DistanceLabelPositions = {
  x?: Vector3Tuple;
  y?: Vector3Tuple;
  z?: Vector3Tuple;
  full: Vector3Tuple;
};

export type MeasureLabelPositions = {
  length?: Vector3Tuple;
  radius?: Vector3Tuple;
  minDistance?: DistanceLabelPositions;
  centerDistance?: DistanceLabelPositions;
  angle?: Vector3Tuple;
  area?: Vector3Tuple;
  round?: Vector3Tuple;
};

export type MeasureRenders = {
  length?: MeasureLabel;
  radius?: MeasureLabel;
  minDistance?: MeasureDistanceObj;
  centerDistance?: MeasureDistanceObj;
  angle?: MeasureAngle;
  area?: MeasureLabel;
  round?: MeasureLabel;
};

export type MeasureRenderObjects =
  | MeasureObject
  | MeasureAngle
  | MeasureDistanceObj
  | DistanceLine
  | MeasureLabel;
